//
//  customLabel.m
//  CalculatorApp
//
//  Created by Michael Geering on 16/03/2010.
//  Copyright 2010 SDC. All rights reserved.
//

#import "customLabel.h"

@implementation customLabel

@synthesize number, format;

- (void) setText:(NSString *)value
{
//	NSLog(@"I am Sam's rad new Label type, setting a value for text!");
	[self setNumber:[[self format] numberFromString:value]];
	[super setText:[format stringFromNumber:number]];
}

- (NSString *)text
{
//	NSLog(@"I am Sam's rad new Label type, returning a value for text!");
	return [super text];
}

- (void) awakeFromNib
{
	format = [[NSNumberFormatter alloc] init];	
	number = [[NSNumber alloc] init];
	[[self format] setNumberStyle:NSNumberFormatterDecimalStyle];
	[[self format] setMaximumIntegerDigits:10];
	[[self format] setMaximumFractionDigits:6];
//	NSLog(@"Number format is %@", [[format formatterBehavior] description]);
}
@end
